package com.axsoft.jobimp.types;

/**
 * 
 * @author RankoR
 *
 * QuadWord is 64-bit integer (in fact - long)
 */
public class QuadWord extends DataType {

	protected long mValue;
	
	public final long getValue() {
		return mValue;
	}
	
	public QuadWord() {
		super(8);
		mValue = 0x00;
	}
	
	public QuadWord(final byte[] pData) {
		super(8);
		
		mValue = (long) parseByteArray(pData);
		setData(pData);
	}
	
	public QuadWord(final long pData) {
		super(8);
		setQuadWord(pData);
	}
	
	public void setQuadWord(final long pData) {
		mData[0] = (byte) (pData >>> 56);
		mData[1] = (byte) (pData >>> 48);
		mData[2] = (byte) (pData >>> 40);
		mData[3] = (byte) (pData >>> 32);
		mData[4] = (byte) (pData >>> 24);
		mData[5] = (byte) (pData >>> 16);
		mData[6] = (byte) (pData >>> 8);
		mData[7] = (byte) (pData);
		
		mValue = pData;
	}
}
